package com.lys.emsystem.service.impl;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.lys.emsystem.mapper.MajorMapper;

import com.lys.emsystem.entity.Major;
import com.lys.emsystem.service.MajorService;
import com.lys.emsystem.vo.MajorVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class MajorServiceImpl implements MajorService {
    @Autowired
    private MajorMapper majorMapper;


    @Override
    public IPage<Major> search(Page<Major> page, MajorVo majorVo) {
        return majorMapper.search(page, majorVo);
    }

    @Override
    public int add(Major major) {
        return majorMapper.insert(major);
    }

    @Override
    public int update(Major major) {
        return majorMapper.updateById(major);
    }

    @Override
    public int delete(int id) {
        return majorMapper.deleteById(id);
    }

    @Override
    public int deleteList(int[] ids) {
        return majorMapper.delList(ids);
    }

    @Override
    public List<Major> searchByCollegeId(int id) {
        return majorMapper.searchByCollegeId(id);
    }
}
